package com.kashow.injector.module;

import android.app.Activity;
import android.content.Context;

import com.kashow.injector.ContextLife;
import com.kashow.injector.PerActivity;
import com.tbruyelle.rxpermissions.RxPermissions;

import dagger.Module;
import dagger.Provides;

@Module
public class ActivityModule {
    private Activity mActivity;
    public ActivityModule(Activity activity) {
        mActivity = activity;
    }

    @Provides
    @PerActivity
    @ContextLife("Activity")
    public Context provideContext() {
        return mActivity;
    }

    @Provides
    @PerActivity
    public Activity provideActivity() {
        return mActivity;
    }


    @Provides
    @PerActivity
    public RxPermissions provideRxPermissions() {
        return new RxPermissions(mActivity);
    }

}
